package com.example.demo.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.dao.DaAnDao;
import com.example.demo.entity.DaAn;
import com.example.demo.entity.Student;
import com.example.demo.service.DaAnService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("daAnService")
public class DaAnServiceImpl implements DaAnService {
    @Resource
    private DaAnDao daAnDao;

    @Override
    public IPage<DaAn> queryAllByLimit(int offset, int limit, DaAn bean) {
        Page<DaAn> page = new Page<>(offset,limit);
//        QueryWrapper<Student> wrapper = new QueryWrapper<>();
//        wrapper.like("account",bean.getAccount())
//                .eq("mobile",bean.getMobile()).
//                gt("reg_date",bean.getStartTime()).
//                lt("reg_date",bean.getEndTime());
        page.setRecords(daAnDao.queryAll(page,bean));
        return page;
    }

    @Override
    public List<DaAn> queryAll(DaAn bean) {
        return null;
    }

    @Override
    public int insert(List<DaAn> list) {
        return daAnDao.insertBatch(list);
    }
}
